<%--
  Created by IntelliJ IDEA.
  User: www
  Date: 2021/10/29
  Time: 15:49
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>添加大礼包</title>
    <link type="text/css" rel="stylesheet" href="fontsawesome/css/font-awesome.css"/>
    <link type="text/css" rel="stylesheet" href="css/style.css"/>
    <link type="text/css" rel="stylesheet" href="css/datepicker.css"/>
</head>
<body>
<div class="main_box">
    <div class="cont_box editpro_box">
        <form action="#" method="post" id="pcard_form">
            <ul class="addpro_box adduser_box">
                <li>
                    <label>手机号：</label>
                    <input type="text" value="${phone}" name="phone" readonly/>
                </li>
                <li>
                    <label>大礼包：</label>
                    <select id="giftnum" name="giftnum" onchange="change()">
                        <option value="大礼包一">大礼包一</option>
                        <option value="大礼包二">大礼包二</option>
                        <option value="大礼包三">大礼包三</option>
                        </select>
                </li>
                <li>
                    <label>礼包详情：</label>
                    <div class="f_left">
                        <p>大礼包价格:<span id="Price">2999</span></p>
                        <p>大礼包有效期:<span id="term">365</span>天</p>
                        <p>活动截止日期:<span><fmt:formatDate value="${time}"></fmt:formatDate></span></p>
                    </div>
                </li>
                <li>
                    <label>礼包服务：</label>
                    <div class="f_left">
                        <p>精湛护理 免费次数:<span id="num1">365</span></p>
                        <p>打蜡 免费次数:<span id="num2">365</span></p>
                    </div>
                </li>
                <li>
                    <label>绑定车牌号：</label>
                    <select name="c_number">
                        <c:forEach items="${MemberCar}" var="Membercar"> <option value="${Membercar.c_number}">${Membercar.c_number}</option></c:forEach>
                    </select>
                </li>
                <li>
                    <label>销售人员：</label>
                    <select name="salesman">
                        <option value="">无销售</option>
                        <c:forEach items="${staff}" var="staff"> <option value="${staff.staff_id}">${staff.s_name}</option></c:forEach>
                    </select>
                </li>
            </ul>
            <div class="probtn_box clearfix">
                <input type="button" value="添加大礼包" class="btn blue_btn submit"/>
            </div>
        </form>
    </div>
</div>
<!--javascript include-->
<script src="js/jquery-2.2.1.min.js"></script>
<script src="js/jquery.dataTables.min.js"></script>
<script src="js/bootstrap-datepicker.js"></script>
<script src="js/jquery.validate.min.js"></script>
<script src="js/jquery.form.min.js"></script>
<script src="js/jquery.cxselect.min.js"></script>
<script src="js/other.js"></script>
<script>
    $(function(){
        $("body").other({formId:"#pcard_form",formUrl:"${pageContext.request.contextPath}/add_SpreeController"});//formUrl 表单请求地址,linkHref 请求成功后跳转地址，此页面不需要，已删除
        $("#carmodel").cxSelect({
            url: "js/carModel.json",
            selects: ["carbrand", "carmodela", "carmodelb", "carmodelc"],
            emptyStyle: "none"
        });

    });
    function change() {
        var myselect=document.getElementById("giftnum");
        var index = myselect.selectedIndex;
        var v = myselect.options[index].value;
        if (v=='大礼包一'){
            document.getElementById("Price").innerHTML='2999'
            document.getElementById("term").innerHTML='2999'
            document.getElementById("num1").innerHTML='365'
            document.getElementById("num2").innerHTML='365'
        }else if (v=='大礼包二'){
            document.getElementById("Price").innerHTML='1999'
            document.getElementById("term").innerHTML='365'
            document.getElementById("num1").innerHTML='183'
            document.getElementById("num2").innerHTML='183'
        }else if (v=='大礼包三'){
            document.getElementById("Price").innerHTML='999'
            document.getElementById("term").innerHTML='180'
            document.getElementById("num1").innerHTML='90'
            document.getElementById("num2").innerHTML='90'
        }
    }
</script>
</body>
</html>